package com.ruoyi.eaten.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.eaten.service.IJjjfoodSupplierService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.eaten.mapper.JjjfoodSupplierMapper;
import com.ruoyi.eaten.domain.JjjfoodSupplier;

/**
 * 供应商Service业务层处理
 *
 * @author ruoyi
 * @date 2025-02-15
 */
@Service
public class JjjfoodSupplierServiceImpl implements IJjjfoodSupplierService
{
    @Autowired
    private JjjfoodSupplierMapper jjjfoodSupplierMapper;

    /**
     * 查询供应商
     *
     * @param shopSupplierId 供应商主键
     * @return 供应商
     */
    @Override
    public JjjfoodSupplier selectJjjfoodSupplierByShopSupplierId(String shopSupplierId)
    {
        return jjjfoodSupplierMapper.selectJjjfoodSupplierByShopSupplierId(shopSupplierId);
    }

    /**
     * 查询供应商列表
     *
     * @param jjjfoodSupplier 供应商
     * @return 供应商
     */
    @Override
    public List<JjjfoodSupplier> selectJjjfoodSupplierList(JjjfoodSupplier jjjfoodSupplier)
    {
        return jjjfoodSupplierMapper.selectJjjfoodSupplierList(jjjfoodSupplier);
    }

    /**
     * 新增供应商
     *
     * @param jjjfoodSupplier 供应商
     * @return 结果
     */
    @Override
    public int insertJjjfoodSupplier(JjjfoodSupplier jjjfoodSupplier)
    {
        jjjfoodSupplier.setCreateTime(DateUtils.getNowDate());
        return jjjfoodSupplierMapper.insertJjjfoodSupplier(jjjfoodSupplier);
    }

    /**
     * 修改供应商
     *
     * @param jjjfoodSupplier 供应商
     * @return 结果
     */
    @Override
    public int updateJjjfoodSupplier(JjjfoodSupplier jjjfoodSupplier)
    {
        jjjfoodSupplier.setUpdateTime(DateUtils.getNowDate());
        return jjjfoodSupplierMapper.updateJjjfoodSupplier(jjjfoodSupplier);
    }

    /**
     * 批量删除供应商
     *
     * @param shopSupplierIds 需要删除的供应商主键
     * @return 结果
     */
    @Override
    public int deleteJjjfoodSupplierByShopSupplierIds(String[] shopSupplierIds)
    {
        return jjjfoodSupplierMapper.deleteJjjfoodSupplierByShopSupplierIds(shopSupplierIds);
    }

    /**
     * 删除供应商信息
     *
     * @param shopSupplierId 供应商主键
     * @return 结果
     */
    @Override
    public int deleteJjjfoodSupplierByShopSupplierId(String shopSupplierId)
    {
        return jjjfoodSupplierMapper.deleteJjjfoodSupplierByShopSupplierId(shopSupplierId);
    }
}
